<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8" %>
<!DOCTYPE html>
<html lang="en">
<head>
    <%
        String path = request.getContextPath();
        String basePath = request.getScheme() + "://"
                + request.getServerName() + ":" + request.getServerPort()
                + path + "/";
    %>
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/>
    <meta charset="utf-8"/>
    <title>YOOUCE 补丁升级工具</title>

    <meta name="description" content="overview &amp; stats"/>
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0"/>

    <!-- bootstrap & fontawesome -->
    <link rel="stylesheet" href="assets/css/bootstrap.min.css"/>
    <link rel="stylesheet" href="assets/css/font-awesome.min.css"/>

    <!-- page specific plugin styles -->

    <!-- text fonts -->
    <link rel="stylesheet" href="assets/css/ace-fonts.css"/>

    <!-- ace styles -->
    <link rel="stylesheet" href="assets/css/ace.min.css" id="main-ace-style"/>

    <link rel="stylesheet" href="assets/css/ace-skins.min.css"/>
    <link rel="stylesheet" href="assets/css/ace-rtl.min.css"/>


    <!-- ace settings handler -->
    <script src="assets/js/ace-extra.min.js"></script>
    <script src="assets/js/jquery-1.10.2.min.js"></script>

    <script src="assets/js/bootstrap.min.js"></script>

    <!-- page specific plugin scripts -->
    <script src="assets/js/fuelux/fuelux.wizard.min.js"></script>
    <script src="assets/js/jquery.validate.min.js"></script>
    <script src="assets/js/additional-methods.min.js"></script>
    <script src="assets/js/bootbox.min.js"></script>
    <script src="assets/js/jquery.maskedinput.min.js"></script>
    <script src="assets/js/select2.min.js"></script>

    <!-- ace scripts -->
    <script src="assets/js/ace-elements.min.js"></script>
    <script src="assets/js/ace.min.js"></script>
</head>

<body>
<div class="main-container" id="main-container">
    <script type="text/javascript">
        try {
            ace.settings.check('main-container', 'fixed')
        } catch (e) {
        }
    </script>

    <div class="main-content">
        <div class="page-content">
            <div class="page-content-area">
                <div class="row">
                    <div class="col-xs-12">
                        <div class="widget-box">
                            <div class="widget-body">
                                <div class="widget-main">
                                    <form class="form-horizontal" id="commitPatchForm">
                                        <div class="widget-box">
                                            <!-- #section:plugins/fuelux.wizard.container -->
                                            <div class="step-content pos-rel" id="step-container">
                                                <div class="step-pane active" id="step1">
                                                    <h3 class="lighter block green">设置服务器信息</h3>
                                                    <!-- #section:elements.form.input-state -->
                                                    <div class="form-group has-warning">
                                                        <label class="col-xs-12 col-sm-3 control-label no-padding-right">服务器IP</label>

                                                        <div class="col-xs-12 col-sm-5">
																<span class="block input-icon input-icon-right">
																	<input type="text" name="serverIp"
                                                                           value="${patchInfo.serverIp}"
                                                                           class="width-100"/>
																	<i class="ace-icon fa fa-leaf"></i>
																</span>
                                                        </div>
                                                    </div>

                                                    <!-- /section:elements.form.input-state -->
                                                    <div class="form-group has-error">
                                                        <label class="col-xs-12 col-sm-3 col-md-3 control-label no-padding-right">用户名</label>

                                                        <div class="col-xs-12 col-sm-5">
																<span class="block input-icon input-icon-right">
																	<input type="text" name="serverUserName"
                                                                           value="${patchInfo.serverUserName}"
                                                                           class="width-100"/>
																	<i class="ace-icon fa fa-times-circle"></i>
																</span>
                                                        </div>
                                                    </div>

                                                    <div class="form-group has-success">
                                                        <label class="col-xs-12 col-sm-3 control-label no-padding-right">密码</label>

                                                        <div class="col-xs-12 col-sm-5">
																<span class="block input-icon input-icon-right">
																	<input type="password" name="serverPassword"
                                                                           value="${patchInfo.serverPassword}"
                                                                           class="width-100"/>
																	<i class="ace-icon fa fa-check-circle"></i>
																</span>
                                                        </div>
                                                    </div>

                                                    <div class="form-group has-info">
                                                        <label class="col-xs-12 col-sm-3 control-label no-padding-right">工程目录</label>

                                                        <div class="col-xs-12 col-sm-5">
																<span class="block input-icon input-icon-right">
																	<input type="text" name="contextPath"
                                                                           value="${patchInfo.contextPath}"
                                                                           class="width-400"/>

																	<i class="ace-icon fa fa-info-circle"></i>
																</span>
                                                        </div>
                                                    </div>

                                                    <div class="form-group has-info">
                                                        <label class="col-xs-12 col-sm-3 control-label no-padding-right">补丁名称</label>

                                                        <div class="col-xs-12 col-sm-5">
																<span class="block input-icon input-icon-right">
																	<input type="text" name="patchRealName"
                                                                           value="${patchInfo.patchRealName}"
                                                                           class="width-400"/>
																	<i class="ace-icon fa fa-info-circle"></i>
																</span>
                                                        </div>
                                                    </div>
                                                    <div class="form-group has-info">
                                                        <label class="col-xs-12 col-sm-3 control-label no-padding-right"></label>

                                                        <div class="col-xs-12 col-sm-5" align="center">

																<span class="block input-icon input-icon-right">
																	<input class="btn btn-success" type="button"
                                                                           value="升级" onclick="doSubmit(1)"/>
																	<input class="btn btn-success"
                                                                           type="button"
                                                                           value="回滚" onclick="doSubmit(2)"/>
																</span>
                                                        </div>
                                                    </div>
                                                    <input type="hidden" name="patchFileName"
                                                           value="${patchInfo.patchFileName}">
                                                </div>
                                            </div>
                                        </div>


                                    </form>
                                </div>
                                <!-- /.widget-main -->
                            </div>
                            <!-- /.widget-body -->
                        </div>


                    </div>
                    <!-- /.col -->
                </div>
                <!-- /.row -->
            </div>
            <!-- /.page-content-area -->
        </div>
        <!-- /.page-content -->
    </div>
    <!-- /.main-content -->


</div>
<script type="text/javascript">

    iframeHeight();
    //iframe 父窗体自适应高度
    function iframeHeight() {
        var ifm = window.parent.document.getElementById("mainFrame");
        if (ifm != null) {
            ifm.height = $("body").height();
        }
    }

    function doSubmit(type)
    {
//        alert(type);
        if (type==1) {
            $("#commitPatchForm").attr("action","/updatePatch").submit();
            return false;
        }
        else {
            $("#commitPatchForm").attr("action","/rollbackPatch").submit();
            return false;
        }
    }

</script>
</body>


